package com.example.demo.controller;

import com.example.demo.service.CustomerService;
import com.example.demo.service.StudentService;
import com.example.demo.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class Controller {
    @Autowired
    StudentService studentService;
    @Autowired
    CustomerService customerService;
    @Autowired
    TeacherService teacherService;
    @GetMapping("/stu")
    public String getStudentByName(){
        String name = "aihua";
        return studentService.getStudentByName(name).toString();
    }
    @GetMapping("/cus")
    public String getCustomer(){
        return customerService.getAllCustomer().toString();
    }

    @GetMapping("/te")
    public String getTeacher(){
        return teacherService.getTeacher().toString();
    }
}
